package cn.itsource.pet.service.impl;


import cn.itsource.basic.service.impl.BaseServiceImpl;
import cn.itsource.basic.util.TreeUtil;
import cn.itsource.pet.domain.PetType;
import cn.itsource.pet.mapper.PetTypeMapper;
import cn.itsource.pet.query.PetTypeQuery;
import cn.itsource.pet.service.IPetTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 万能键 alt + enter
 */
@Service //交给spring管理
public class PetTypeServiceImpl extends BaseServiceImpl<PetType, PetTypeQuery> implements IPetTypeService {

    /**
     * 注入mapper层对象
     */
    @Autowired
    private PetTypeMapper petTypeMapper;


    @Override
    public List<PetType> treeList() {

        List<PetType> petTypes = petTypeMapper.findAll();

        return TreeUtil.getTree(petTypes);
    }
}
